<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    <title>时间戳高亮</title>
    
        
    <!-- Site CSS -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <!--<link href="http://static.bootcss.com/www/assets/css/site.min.css?v5" rel="stylesheet">-->
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="/assets/js/html5shiv.min.js?v=1f65f1e951"></script>
      <script src="/assets/js/respond.min.js?v=1f65f1e951"></script>
    <![endif]-->
    
</head>
<body>
   
   
     <div class="container">

    <div class="row">
        <h1 class="text-center">服端端贴纸md5映射<small>http://10.10.1.55:9090/getSysEmojiInfo</small></h1>
        <div class="form-group">
          <label for="in">in</label>
          <textarea class="form-control" id="in" rows="10"></textarea>
        </div>
       <!--  <button  class="btn btn-default" id="fix" >fix</button> -->
        <button  class="btn btn-default" id="show" >show</button>

        <div class="form-group">
          <label for="out">out</label>
          <textarea class="form-control" id="out" rows="10"></textarea>
        </div>
      
    </div>
  </div>
  
   
       <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
    
      <script type="text/javascript">


      function fix(x){
          if(!x) return x;
          

          if( /\}\n.\{/ig.test(x) ){
            x = x.replace(/\}\{/,'},{');
            return x;
          }

          return x;

      }
      //转成map
      function showMap(x){
        console.log(x);
        return;
        x=x.replace(/\\n/ig,'');
        x=x.replace(/\\"/ig,'"');
    
        // return x;
        var data=$.parseJSON(x);
        console.log(data);
        var out=[];
         
         $.each(data.EmojiInfo,function(i,one){
             $.each(one.EmojiMd5List,function(j,two){
                out.push('"'+two.Md5+'":"'+one.EmojiDepict+'"');
            });
         });

         return '{'+out.join(',')+'}';
      }
      //config
       function show(x){
        console.log(x);
        return x;
        x=x.replace(/\\n/ig,'');
        x=x.replace(/\\"/ig,'"');
        // return x;
        var data=$.parseJSON(x);
        console.log(data);
        var out=[];
         
         $.each(data.EmojiInfo,function(i,one){
             $.each(one.EmojiMd5List,function(j,two){
                out.push(two.Md5+'='+one.EmojiDepict);
            });
         });

         return  out.join('\n') ;
      }

      $(function  (argument) {
           $('#fix').click(function(){

              var x=$('#in').val();

              $('#in').val(fix(x));
 
           });

           $('#show').click(function(){

              var x=$('#in').val();

              $('#out').val(show(x));
 
           });

      });

  </script>

</body>

</html>